<template>
  <div class="ele-body">
    <el-tabs v-model="tabName" type="border-card" @tab-click="handleClick">
      <el-tab-pane name="department" label="部门" />
      <el-tab-pane name="person" label="人员" />
      <el-tab-pane name="client" label="终端" />
      <el-tab-pane name="vlan" label="网段" />
      <el-tab-pane name="domain" label="域名" />
      <el-tab-pane name="area" label="区域" />
      <el-tab-pane name="scanner" label="扫描器" />
      <router-view />
    </el-tabs>
  </div>
</template>

<script>
export default {
  name: 'SystemBase',
  data() {
    return {
      tabName: 'department'
    }
  },
  mounted() {
    const path = this.$route.path.split('/')
    this.tabName = path[path.length - 1]
  },
  methods: {
    handleClick(tab, event) {
      this.$router.push(`/system/base/${tab.name}`)
    }
  }
}
</script>

<style lang="scss" scoped>

</style>
